package com.hb.trade.client.center;

import com.hb.core.pojo.center.au.dto.OrgDeptDTO;
import com.hb.core.pojo.center.au.entity.OrgDept;
import com.hb.core.pojo.parent.PageResult;
import org.fzzn.core.model.msg.Message;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * describe:
 *
 * @author zhongdl
 * @date 2022/01/20
 */
@FeignClient("hb-center")
public interface OrgDeptClient {
    /**
     * @param orgDept:
     * @Description: 分页查询部门列表
     * @Author: zhongdl
     * @Date:2022/1/20 14:52
     * @return: {@link Message< PageResult< OrgDeptDTO>> }
     **/
    @PostMapping("/orgDept/pageOrgDept")
    Message<PageResult<OrgDeptDTO>> pageOrgDept(@RequestBody OrgDeptDTO orgDept);

    /**
     * @param orgDept:
     * @Description: 保存部门
     * @Author: zhongdl
     * @Date:2022/1/20 16:11
     * @return: {@link Message< Boolean> }
     **/
    @PostMapping("/orgDept/saveOrgDept")
    Message<String> saveOrgDept(@RequestBody OrgDeptDTO orgDept);

    /**
     * @param orgDept:
     * @Description: 根据id查询部门详情
     * @Author: zhongdl
     * @Date:2022/1/20 16:23
     * @return: {@link Message< OrgDeptDTO> }
     **/
    @PostMapping("/orgDept/getOrgDeptId")
    Message<OrgDeptDTO> getOrgDeptId(@RequestBody OrgDeptDTO orgDept);

    /**
     * @param userId:
     * @Description:根据用户id查询部门详情
     * @Author: zhongdl
     * @Date:2022/5/6 1:49
     * @return: {@link org.fzzn.core.model.msg.Message<com.hb.core.pojo.center.au.dto.OrgDeptDTO> }
     **/
    @PostMapping("/orgDept/getOrgDeptByUserId")
    Message<OrgDeptDTO> getOrgDeptByUserId(@RequestParam Long userId);


    /**
     * @param orgDept:
     * @Description: 根据id删除部门
     * @Author: zhongdl
     * @Date:2022/1/20 16:32
     * @return: {@link Message< Boolean> }
     **/
    @PostMapping("/orgDept/removeById")
    Message<Boolean> removeById(@RequestBody OrgDeptDTO orgDept);

    /**
     * @param orgDept:
     * @Description: 查询企业部门列表(不带分页)
     * @Author: zhongdl
     * @Date:2022/2/14 8:45
     * @return: {@link Message< List< OrgDept>> }
     **/
    @PostMapping("/orgDept/listOrgDept")
    Message<List<OrgDept>> listOrgDept(@RequestBody OrgDeptDTO orgDept);



    /**
     * 查询当前用户所在部门下的所有用户
     *
     * @param userId
     * @return
     */
    @PostMapping("/orgDept/listUserIdsByWorkMate")
    Message<List<Long>> listUserIdsByWorkMate(@RequestParam("userId") Long userId);
}
